package com.zero2oneblog.vo;

//import com.zero2oneblog.validator.FullName;
import com.zero2oneblog.entity.UserInfo;
import com.zero2oneblog.validator.NickName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserInfoRegisterRequestVO { //这个不知道算不算VO啊

    @NickName //这里是验证用户名是否合法
    @NotBlank
    private String userName;

    @NotBlank
    private String password;

//    @NickName //这里是验证用户名是否合法
//    @NotBlank
//    private String nickName;

    public UserInfo toUser() {
        return UserInfo.builder()
                .username(this.getUserName()).build();  //感觉lombok好难用，可理解性很差

    }
}
